﻿using System;
using System.Collections.Generic;
using System.Text;
using DataLayer.Objects;
using Developex.DatabaseWrapper;

namespace DataLayer.ObjectLists
{
	public class UsersList : RowList<SiteUser>
	{
		public List<SiteUser> GetUsers(Connection conn, string subName, int? age)
		{
			QueryBuilder qb = GetQueryBuilder(conn);
			if (age != null)
				qb.AddWhereCondition(conn, SampleItem.age, age);
			if (!string.IsNullOrEmpty(subName))
				qb.AddSearchCondition(conn, SampleItem.name, subName);
			return LoadItemsFromQueryBuilder(conn, qb);
		}
	}
}
